//
//  FutureMatchViewCell.m
//  LiveSoftware
//
//  Created by lanou3g on 15/7/20.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "FutureMatchViewCell.h"

#import "DetailBasketbModel.h"
@interface FutureMatchViewCell ()

/**
 *赛事
 */
@property(nonatomic,strong)UILabel*leagueName;

/**
 *开始时间
 */
@property(nonatomic,strong)UILabel*beginTime;

/**
 *客
 */
@property(nonatomic,strong)UILabel*visitName;


/**
 *主
 */
@property(nonatomic,strong)UILabel *hostName;


/**
 *赛果
 */
@property(nonatomic,strong)UILabel *result;
/**
 *总分
 */
@property(nonatomic,strong)UILabel*score;



/**
 *一共
 */
@property(nonatomic,strong)UILabel *total;

/**
 *gap
 */
@property(nonatomic,strong)UILabel *gap;



@end@implementation FutureMatchViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        
        
        float partX = kScreenIp6(10);
        float partY= 0;
        float partWidth = kScreenIp6(60);
        float partHeight = 35;
        
        
        CGFloat teamWidth = (kScreenWidth - partWidth*3 - kScreenIp6(40)) / 2;
        
        
        //赛事
        self.leagueName = [[UILabel alloc]initWithFrame:CGRectMake(partX, partY, partWidth, partHeight)];
        
        self.leagueName.font = [UIFont systemFontOfSize:14];
        self.leagueName.textAlignment = NSTextAlignmentCenter;
        self.leagueName.text = @"赛事";
        
        [self.contentView addSubview:_leagueName];
        
        
        //开始时间
        self.beginTime = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.leagueName.frame), partY, partWidth + kScreenIp6(10), partHeight)];
        self.beginTime.font = [UIFont systemFontOfSize:12];
        self.beginTime.textAlignment = NSTextAlignmentCenter;
        
        self.beginTime.text = @"日期";
        
        [self.contentView addSubview:_beginTime];
        
        
        
        
        
        //客
        self.visitName = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.beginTime.frame) + kScreenIp6(5), partY, teamWidth, partHeight)];
        self.visitName.font = [UIFont systemFontOfSize:14];
        self.visitName.adjustsFontSizeToFitWidth = YES;
       self.visitName.textAlignment = NSTextAlignmentCenter;
        self.visitName.text = @"客";
        [self.contentView addSubview:_visitName];
        
        
        
        //主
        self.hostName = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.visitName.frame), partY, teamWidth, partHeight)];
        self.hostName.font = [UIFont systemFontOfSize:14];
        self.hostName.textAlignment = NSTextAlignmentCenter;
        self.hostName.text = @"主";
        self.hostName.adjustsFontSizeToFitWidth = YES;
        
        [self.contentView addSubview:_hostName];
        
        
        
        //间隔
        self.gap = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.hostName.frame) + kScreenIp6(5), partY, partWidth, partHeight)];
        self.gap.font = [UIFont systemFontOfSize:14];
        self.gap.textAlignment = NSTextAlignmentCenter;
        
        self.gap.text = @"间隔";
        [self.contentView addSubview:_gap];
        
        
        //线
        UIView *footLineView = [[UIView  alloc]initWithFrame:CGRectMake( 0, 35, kScreenWidth, 0.5)];
        
        footLineView.backgroundColor = [UIColor colorWithWhite:0.699 alpha:1.000];
        
        [self.contentView addSubview:footLineView];
        
        
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;

    }
    
    return self;
}

-(void)setCellValueWithModel:(DetailBasketbModel *)model
{
    
    self.leagueName.text = model.leagueName;
    self.beginTime.text = model.beginTime;
    
    self. visitName.text = model.visitName ;
    
    self.hostName.text = model.hostName;

    
    self.gap.text = [NSString stringWithFormat:@"%@天", model.gap];
    
}




- (void)customTextColor
{
    self.leagueName.textColor = [UIColor grayColor];
    self.beginTime.textColor = [UIColor grayColor];
    self.visitName.textColor = [UIColor grayColor];
    self.hostName.textColor = [UIColor grayColor];
    self.gap.textColor = [UIColor grayColor];
}



@end
